#! /usr/bin/env python
# -*- coding: utf-8 -*-

# *************************************************************
#  Copyright (c) Huoty - All rights reserved
#
#      Author: Huoty <sudohuoty@gmail.com>
#  CreateTime: 2016-12-29 20:06:55
# *************************************************************


from contextlib import contextmanager
  
@contextmanager
def make_context() :
    print 'enter'
    try :
        yield {}
    except RuntimeError, err :
        print 'error' , err
    finally :
        print 'exit'


# Script starts from here

if __name__ == "__main__":
    with make_context() as value :
        print value
        #raise RuntimeError
